package com.shierke.Ume.ui.activity.explore

import android.content.Context
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import com.library.flowlayout.FlowLayoutManager
import com.library.flowlayout.SpaceItemDecoration
import com.shierke.Ume.R
import com.shierke.Ume.base.BaseActivity
import com.shierke.Ume.base.BaseNoTitleActivity
import com.shierke.Ume.ui.adapter.explore.ExploreHistoryAdapter
import com.shierke.Ume.ui.adapter.explore.SearchHotAdapter
import com.shierke.Ume.util.click
import com.shierke.Ume.util.startActivity
import kotlinx.android.synthetic.main.activity_search_history_hot.*
import net.lucode.hackware.magicindicator.buildins.UIUtil

/**
 * Create by Ybx
 * on 2020-10-15
 * Desribe:
 */
class SearchHistoryAndHotActivity : BaseNoTitleActivity() {


    companion object {
        fun startActivity(context: Context) {
            context.startActivity<SearchHistoryAndHotActivity>()
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_search_history_hot)



        cancle.click {
            SearchResultActivity.startActivity(this)
        }

        hitstoryRecycle.layoutManager = object : FlowLayoutManager(){
            override fun canScrollHorizontally(): Boolean {
                return false
            }
        }
        hitstoryRecycle.addItemDecoration( SpaceItemDecoration(UIUtil.dip2px(this,8.0)))


        val exploreHistoryAdapter = ExploreHistoryAdapter()
        hitstoryRecycle.adapter = exploreHistoryAdapter



        hotRecycle.layoutManager = object : LinearLayoutManager(this) {
            override fun canScrollVertically(): Boolean {
                return false
            }
        }
        val hotAdapter = SearchHotAdapter()
        hotRecycle.adapter = hotAdapter


    }
}